<?php

if (!function_exists('userLoginLog')) {
    
    /**
     * 用户登录记录
     * @param string $text
     */
    function userLoginLog($uid)
    {
        if(empty($uid)) return ;
        
        $login = [
            'ip'        => request()->ip(),
            'uid'       => $uid,
            'createtime'=> time()
        ];
        model('UserLogin')->allowField(true)->save($login);
    }
}